<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('distance/index')}">车主发布行程</a></li>
    </ul>
    <form method="post" class="js-ajax-form margin-top-20">
        <div class="table-actions">
            <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
        </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="50">ID</th>
				<th>昵称</th>
				<th>头像</th>
                <th>出发地</th>
				<th>目的地</th>
				<th>乘坐数量</th>
				<th>备注</th>
				<th>出发时间</th>
				<th>价格</th>
                <th width="160">状态</th>
            </tr>
            </thead>
            <tbody>
			<?php $array=array('1'=>'申请中','2'=>'等待服务','3'=>'拒绝服务','4'=>'车主出发','5'=>'车主到达','6'=>'乘客已上车','7'=>'乘客到达目的地','8'=>'订单已取消'); ?>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.id}</td>
					<td>{$vo.nick}</td>
                    <td><img style="width:40px;height:40px;border-radius:50%;" src="http://pinche.trackline.cn/interface/public/uploads/{$vo.avatar}"/></td>
					<td>{$vo.departure}</td>
					<td>{$vo.destination}</td>
					<td>{$vo.num}</td>
					<td>{$vo.remark}</td>
					<td>{$vo.starttime}</td>
					<td>{$vo.price}</td>
                    <td>
                        <!-- <a class="js-ajax-delete" href="{:url('Other/deleteversion',['id'=>$vo['id']])}">删除</a> -->
						{$array[$vo.state]}
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="table-actions">
            <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
        </div>
    </form>
    <ul class="pagination">{$page|default=''}</ul>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/layer/layer.js"></script>
<script>
	function agree(id){
		layer.confirm('确定要同意么？',function(){
			$.ajax({
				type:'post',
				url:"{:url('auth/cardagree')}",
				data:'id='+id,
				success:function(msg){
					if(msg.code==1){
						layer.alert('已同意',{'icon':1},function(){
							history.go(0)
						});
					}else{
						layer.alert('操作失败');
					}
				}
			})
		})
	}
	
	function reject(id){
		layer.confirm('确定要拒绝么？',function(){
			$.ajax({
				type:'post',
				url:"{:url('auth/cardreject')}",
				data:'id='+id,
				success:function(msg){
					if(msg.code==1){
						layer.alert('已拒绝',{'icon':1},function(){
							history.go(0)
						});
					}else{
						layer.alert('操作失败');
					}
				}
			})
		})
	}
</script>
</body>
</html>